<template>
  <el-descriptions ref="ruleFormRef" :column="2" direction="vertical" v-loading="isLoading">


<el-descriptions-item width="50%" :label='titles.unityName'>
	{{ isNullOrEmpty( formInline?.unityName ) }}
</el-descriptions-item>
<el-descriptions-item width="50%" label='项目名称'>
	{{ isNullOrEmpty( formInline?.projectName ) }}
</el-descriptions-item>

<el-descriptions-item width="50%" :label='titles.productName'>
	{{ isNullOrEmpty( formInline?.productName ) }}
</el-descriptions-item>
<el-descriptions-item width="50%" :label='titles.place'>
	{{ isNullOrEmpty( formInline?.place ) }}
</el-descriptions-item>
<el-descriptions-item width="50%" label='设备编号'>
	{{ isNullOrEmpty( formInline?.deviceId ) }}
</el-descriptions-item>

<el-descriptions-item width="50%" :label='titles.alarmTitle'>
	{{ isNullOrEmpty( formInline?.alarmTitle ) }}
	
</el-descriptions-item>
<el-descriptions-item width="50%" :label='titles.confirm'>
	{{ formInline?.confirm == '-1' ? '待确认' 
	:  formInline?.confirm == 1 ? '真实'
	 :  formInline?.confirm == 2 ? '误报' 
	  : formInline?.confirm ==3 ? '测试':'忽略' }}
</el-descriptions-item>
<el-descriptions-item width="50%" :label='titles.alarmType'>
	{{ isNullOrEmpty( formInline?.alarmType == 1 ? '告警' : formInline?.alarmType == 2 ? '故障' :'离线' ) }}
</el-descriptions-item>

<el-descriptions-item width="50%" :label='titles.createdAt'>
	{{ isNullOrEmpty( formInline?.confirmAt ) }}
</el-descriptions-item>  </el-descriptions>
</template>

<script setup lang="ts">
import { isNullOrEmpty } from '@/utils/functions'
import { ref } from "vue";
import { titles } from './index';
import { ALARMTYPE, ALARMTYPES, CONFIRMSTATUSTEXT, CONFIRMSTATUS, HANDLESTATUS, EVENTLEVEL, HANDLESTATUSTEXT } from "@/constant/alarm-mangenment";
import type { infoType } from '@/api/manage/regulatory-authorities/regulatory-authorities/index';
type FormProps = {
	formInline: infoType,
	isLoading: boolean
}

const props = withDefaults(defineProps<FormProps>(), {
	formInline: () => ({} as infoType),
	isLoading: false
});

const ruleFormRef = ref();
//  const newFormInline = ref(props.formInline as any);
//
//
//  watch(()=>props.formInline,()=>{
//  	newFormInline.value = props.formInline
//  },{
//  	deep:true,
//  	immediate:true
//  })

function getRef() {
	return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
